# CMake最低版本号要求
cmake_minimum_required(VERSION 3.20)

# 项目信息
project(demo)
set(CMAKE_CXX_STANDARD 17)

# 外部库
find_package(OpenMP REQUIRED)
if(OPENMP_FOUND)
    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS})
    set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS})
else()
    message(FATAL_ERROR "OpenMP NOT FOUND!")
endif()

# 查找当前目录下的所有源文件，并将名称保存到 DIR_SRCS 变量
aux_source_directory(. SRC_LIST)

# 指定生成目标
add_executable(${PROJECT_NAME} ${SRC_LIST})